<template>
  <div class="mytitle">
    <el-row>
      <Titlebtn type="min" />
      <Titlebtn type="max" />
      <Titlebtn type="close" />
    </el-row>
  </div>
</template>
<script>
// import { ipcRenderer } from 'electron'
import Titlebtn from './menu/Titlebtn'
export default {
  name: 'TitleFrame',
  data () {
    return {
    }
  },
  components: { Titlebtn },
  created () {
  },
  methods: {
    // 打开登录窗体
    openLoginWindow () {
      const electron = require('electron')
      const remote = electron.remote
      remote.getCurrentWindow().restore() // 最大化
      // ipcRenderer.send('openLoginPageWindow')
    },
    // 最小化窗体
    minWindow () {
      const electron = require('electron')
      const remote = electron.remote
      remote.getCurrentWindow().minimize()
    },
    // 最大化窗体
    maxWindow () {
      // ipcRenderer.send('minWindow')
      const electron = require('electron')
      const remote = electron.remote
      remote.getCurrentWindow().maximize() // 最大化
      // ipcRender.send('maxWindow')
    },
    // 关闭窗体
    closeWindow () {
      // ipcRenderer.send('closeWindow')
      const electron = require('electron')
      const remote = electron.remote
      remote.getCurrentWindow().close()
    }
  }
}
</script>
<style>
.mytitle {
  width: 100%;
  height: 28px;
  background-color:#545c64;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  -webkit-app-region: drag;
}
</style>